using System.Windows;
using System.Windows.Media.Imaging;

namespace AndyPike.Experiments.Fluent
{
    public struct ImageInfo
    {
        public Int32Rect Rect;
        public int BytesPerPixel;
        public int Stride;
        public int TotalBytes;
        public int TotalPixels;

        public ImageInfo(BitmapSource image)
        {
            Rect = new Int32Rect(0, 0, image.PixelWidth, image.PixelHeight);
            BytesPerPixel = (image.Format.BitsPerPixel + 7) / 8;
            Stride = image.PixelWidth * BytesPerPixel;
            TotalBytes = Stride * image.PixelHeight;
            TotalPixels = image.PixelWidth * image.PixelHeight;
        }       
    }
}